<template>
<div class="batdetail">
    <wxc-minibar title="合买详情">
        <!-- <text style="font-family: PingFangSC-Medium;font-size: 34px;color: #fff;" slot="middle">合买详情</text> -->
        <!-- <image slot="right" style="height: 32px;width: 32px;" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/share.png" v-if="statusDescribe!=702"></image> -->
    </wxc-minibar>
    <scroller class="scroller" style="position:fixed;top:100px;bottom:100px;left:0;right:0;background-color: #F5F5F5;">
        <div class="scheme_title">
            <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #666666;">方案信息</text>
        </div>
        <div class="batdetail_desc">
            <div class="batdetail_desc_fl">
                <div class="batdetail_desc_fl_item">
                    <text style="font-size: 24px;color: #333333;">方案编号：</text>
                    <text style="font-size: 24px;color: #333333;">{{schemeinfo.schemeNo}}</text>
                </div>
                <div class="batdetail_desc_fl_item">
                    <text style="font-size: 24px;color: #333333;">彩种：</text>
                    <text style="font-size: 24px;color: #333333;">{{ map.lotteryName}} </text>
    
                </div>
                <div class="batdetail_desc_fl_item">
                    <text style="font-size: 24px;color: #333333;">总金额：</text>
                    <text style="font-size: 24px;color: #333333;" v-if="schemeinfo.sorders.length > 0">{{schemeinfo.money * schemeinfo.sorders.length }}元</text>
                    <text style="font-size: 24px;color: #333333;" v-else>{{schemeinfo.money }}元</text>
                </div>
                <div class="batdetail_desc_fl_item">
                    <text style="font-size: 24px;color: #333333;">盈利佣金：</text>
                    <text style="font-size: 24px;color: #333333;">{{schemeinfo.remuneration}}%</text>
                </div>
                <div class="batdetail_desc_fl_item">
                    <text style="font-size: 24px;color: #333333;">发起人：</text>
                    <text  style="font-size: 24px;color: #333333;;" v-if="nickname">{{nickname}}</text>
                </div>
            </div>
            <div class="batdetail_desc_fr">
                <div class="batdetail_desc_fr_item">
                    <text style="font-size: 24px;color: #333333;">合买用户：</text>
                    <text style="font-size: 24px;color: #076BF2;line-height: 33px;">{{schemeinfo.spartinCount}}</text>
                    <text style="font-size: 24px;color: #333333;">人已参与跟单</text>
                </div>
                <div class="batdetail_desc_fr_item">
                    <text style="font-size: 24px;color: #333333;">进度：</text>
                    <text style="font-size: 24px;color: #333333;">{{(schemeinfo.buyMoney / schemeinfo.money*100).toFixed(2)}}%</text>
                </div>
                <div class="batdetail_desc_fr_item">
                    <text style="font-size: 24px;color: #333333;">保底：</text>
                    <text style="font-size: 24px;color: #333333;">{{ schemeinfo.safeguardMoney }} 元</text>
                </div>
            </div>
        </div>
        <!-- 表格布局 -->
        <div class="batdetail_table_title">
            <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #666666;">选号方案</text>
        </div>
        <div class="batdetail_table">
            <arrow35 v-if="schemeinfo.lotteryId==3||schemeinfo.lotteryId==4||schemeinfo.lotteryId==5" :tablelist="tablelist" :multiple="multiple"></arrow35>
            <dobbleball v-if="schemeinfo.lotteryId==1||schemeinfo.lotteryId==2" :tablelist="tablelist" :multiple="multiple" :lotteryId="schemeinfo.lotteryId"></dobbleball>
            <div class="table_subdesc">
                <text style="font-size: 24px;color: #A7A7A7;margin-right:10px;">{{ map.lotteryName}}</text>
                <text style="font-size: 24px;color: #A7A7A7;">共{{schemeNumberUnit}}注，追{{perids}}期</text>
            </div>
        </div>
        <!-- 表格布局结束 -->
        <!-- 开奖信息折叠栏开始 -->
        <div class="batdetail_lotteryinfo_title">
            <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #666666;">开奖信息</text>
        </div>
        <div class="batdetail_lotteryinfo" v-if="statusDescribe!=701&&statusDescribe!=702">
            <div style="position:relative;" v-for="(item,index) in lotterylist" :key="index" class="backgroud0">
                <div class="showtab" @click="tabactive(item,index)" :class="[index%2===0?'backgroud1':'backgroud2']">
                    <div class="showtabcontent_fl">
                        <text style="font-size: 30px;color: #333333;">{{ map.lotteryName}}</text>
                        <text style="font-size: 30px;color: #333333;">第{{item.issueIssue}}期</text>
                    </div>
                    <div class="arrowposition" :style="{opacity: item.status != 'true' ? 1: 0}">
                        <image style="width:24px;height:13px; font-size:10px" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/downshow.png"></image>
                    </div>
                    <div class="arrowposition1" :style="{opacity: item.status == 'true' ? 1: 0}">
                       
                        <image style="width:48px;height:48px; font-size;14px" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/arrowupred.png"></image>
                    </div>
                </div>
                <div class="showcontent" v-if="!!item.status" :class="[index%2===0?'backgroud1':'backgroud2']">
                    <div class="number">
                        <div class="bGroup">
                            <text class="forward" v-for="(item1,index) in item.forward" :key="index+1/9">{{item1}}</text>
                            <text class="backward" v-for="(item1,index) in item.backward" :key="index+1/10">{{item1}}</text>
                        </div>
                    </div>
                    <div v-if="item.statusDescribe==401||item.statusDescribe==601">
                        <div class="lottery_money">
                            <text style="font-size:28px;color:#333333;font-family: PingFangSC-Medium;">中奖总金额：</text>
                            <text style="font-size:32px;color:rgb(217,76,68);">{{item.prize}}</text>
                            <text style="font-size:28px;color:#333333;font-family: PingFangSC-Medium;">元</text>
                        </div>
                        <div class="lottery_thead">
                            <div class="lottery_thead_item"><text style="font-size: 24px;color: #666666;">奖项</text></div>
                            <div class="lottery_thead_item"> <text style="font-size: 24px;color: #666666;">中奖注数</text></div>
                            <div class="lottery_thead_item"><text style="font-size: 24px;color: #666666;">奖金(元)</text></div>
                            <div class="lottery_thead_item1"> <text style="font-size: 24px;color: #666666;">税后奖金(元)</text></div>
                        </div>
                        <div v-for="(i,index) in item.prizeDetail" :key="index/11">
                            <div class="lottery_tbody">
                                <div class="lottery_thead_item"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{i.level}}</text></div>
                                <div class="lottery_thead_item">
                                    <text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{i.number}}注</text>
                                    <text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;" v-if="item.append == 1">加追</text>
                                </div>
                                <div class="lottery_thead_item"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{i.money}}</text></div>
                                <div class="lottery_thead_item1"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{i.afterMoney}}</text></div>
                            </div>
                        </div>
                        <div class="lottery_total">
                            <div class="lottery_thead_item"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">合计</text></div>
                            <div class="lottery_thead_item"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{item.numbertotal}}注</text></div>
                            <div class="lottery_thead_item"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{item.moneytotal}}</text></div>
                            <div class="lottery_thead_item1"><text style="font-family: PingFangSC-Medium;font-size: 24px;color: #444444;">{{item.afterMoneytotal}}</text></div>
                        </div>
                        <div class="last_one_lottery_total">
                            <div class="last_one_lottery_detail">
                                <div class="last_lottery_detail_fr">
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">盈利佣金：</text>
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">{{item.profitmoney}}元</text>
                                </div>
                                <div class="last_lottery_detail_fr">
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">剩余奖金：</text>
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">{{item.surplusmoney}}元</text>
                                </div>
                            </div>
                            <div class="last_second_lottery_detail">
                                <div class="last_second_lottery_detail_item">
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">我的</text>
                                </div>
                                <div class="last_second_lottery_detail_item1">
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">认购额：</text>
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #333333;">{{item.subscriptionmoney}}元</text>
                                </div>
                                <div class="last_second_lottery_detail_item1">
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #E70D0D;">分成奖金：</text>
                                    <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #E70D0D;">{{item.dividemoney}}元</text>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="nozhongjiang" v-if="item.statusDescribe!=401&&item.statusDescribe!=601&&!item.waitlottery">
                        <text style="font-size: 24px;color: #444444;">很遗憾，您购买的号码未能中奖</text>
                    </div>
                    <div class="nozhongjiang" v-if="item.waitlottery">
                        <text style="font-size: 24px;color: #444444;">等待开奖</text>
                    </div>
                </div>
                <image class="lottery_img" v-if="item.status&&item.statusDescribe==401" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/zhongjiang.png"></image>
                <image class="lottery_img" v-if="item.status&&item.statusDescribe==601" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/alreadyprice.png"></image>
            </div>
        </div>
        <div class="scheme_message">
            <text style="font-family: PingFangSC-Medium;font-size: 28px;color: #666666;margin-bottom:32px;">方案宣言</text>
            <text style="font-size: 28px;color: #999999;margin-bottom:24px;">标题：</text>
            <text class="desc">{{schemeinfo.title}}</text>
            <text style="font-size: 28px;color: #999999;margin-bottom:24px;">描述：</text>
            <text class="desc">{{schemeinfo.describetion}}</text>
        </div>
        <!-- 开奖信息折叠栏结束 -->
    </scroller>
    <div class="bottombutton" v-if="persontype==1&&statusDescribe!=702">
        <wxc-button text="修改保底" :btnStyle="btnStylechange" :textStyle="textStylechange" @wxcButtonClicked="changorder"></wxc-button>
        <wxc-button text="撤单" :textStyle="textStylecancle" :btnStyle="btnStylecancle" @wxcButtonClicked="cancleorder"></wxc-button>
    </div>
    <loading-big v-if="loadingshow"></loading-big>
    <!-- <wxc-loadingsp :show="loadingshow" type="custom" :need-mask="true" loading-text="加载中..." m-url="http://img.alicdn.com/tfs/TB1Ep_9NVXXXXb8XVXXXXXXXXXX-74-74.gif" m-width="200" m-height="200" m-backgroundcolor="#212021" m-textcolor="#ffffff">
    </wxc-loadingsp> -->
</div>
</template>

<script>
const modal = weex.requireModule("modal");
import WxcMinibar from "@/components/modules/wxc-minibar/index.js";
import {
    WxcButton
} from "weex-ui";
import { postResponsesToken} from "@/api.js";
import {
    debug
} from "util";
import {
    serialize,
    getBaseUrl,
    jsonAnalysis
} from "@/utils/index.js";
import arrow35 from "@/components/modules/table-item/arrow3_5";
import dobbleball from "@/components/modules/table-item/dobble_colorball";
const navigator = weex.requireModule("navigator");
var sxglobalEvent = weex.requireModule("globalEvent");
import WxcLoadingsp from "../../components/modules/loading";
import { lotteryTypes } from '@/js/global/index_data'
import loadingBig from "@/components/modules/loading-big";


export default {
    data() {
        return {
            minLimit: -1, //最低限制
            currentOrder: null,
            loadingshow: false,
            btnDisabledcancle: false,
            btnDisabledchange: false,
            btnStylechange: {
                backgroundColor: "#E70D0D",
                width: "375px",
                height: "100px",
                borderRadius: "0px"
            },
            textStylechange: {
                color: '#FFFFFF',
                fontSize: '32px'
            },
            btnStylecancle: {
                backgroundColor: "#fff",
                width: "375px",
                height: "100px",
                borderRadius: "0px"
            },
            textStylecancle: {
                color: "#999",
                fontSize: '32px'
            },
            persontype: "", // 1 为发起人  2位参与人
            btnDisabled: false,
            status: null,
            schemeinfo: "",
            nickname: "",
            multiple: "",
            schemeNumberUnit: "",
            statusDescribe: "",
            perids: "",
            waitlottery: false,
            batdetaillist: [],
            tablelist: [],
			lotterylist: [],
			map:{},
            tableHeadData: ["序号", "前区", "后区", "备注", "倍数"]
        };
    },
    created() {
        let personalDetails = jsonAnalysis(weex.config.bundleUrl.split("?")[1]);
		this.currentOrder = personalDetails;
		
		this.schemeinfo = JSON.parse(this.currentOrder.map)
		this.schemeinfo.lotteryId = lotteryTypes[this.currentOrder.lotteryNo].id;

		

        this.statusDescribe = this.currentOrder.statusDescribe;
		
		let maps = JSON.parse(this.currentOrder.map)
		
		this.map = maps

        this.minLimit = maps.schemeCancel
        // modal.alert({message:JSON.stringify(maps)});


        if (Boolean(maps.self)) {
            this.persontype = 1
        } else {
            this.persontype = 2
        }

        let prizeDetails = maps.sorders
        let betContent = JSON.parse(this.currentOrder.betContent)

        prizeDetails.length > 0 && (this.multiple = maps.sorders[0].multiple);

        this.nickname = this.currentOrder.nickname;
        this.schemeNumberUnit = this.currentOrder.schemeNumberUnit;
        this.perids = this.currentOrder.issueSum;
		
        this.filterlotteryinfo(betContent) //过滤彩种信息
        this.drawlottery(prizeDetails);
        this.buttonstyle();
    },
    components: {
        WxcMinibar,
        arrow35,
        dobbleball,
        WxcButton,
        WxcLoadingsp,
        loadingBig
    },

    methods: {
        
        filterlotteryinfo(betContent) {
            if (this.schemeinfo.lotteryId == 1 || this.schemeinfo.lotteryId == 2) {
                // 双色球  大乐透
                this.filter_ball(betContent);
            }
            if (
                this.schemeinfo.lotteryId == 3 ||
                this.schemeinfo.lotteryId == 4 ||
                this.schemeinfo.lotteryId == 5
            ) {
                if (this.schemeinfo.lotteryId == 3 || this.schemeinfo.lotteryId == 4) {
                    //福彩3d  排列三
                    this.filterarrow_3_4(betContent);
                } else if (this.schemeinfo.lotteryId == 5) {
                    // 排列五
                    this.filterarrow_5(betContent);
                }
            }
        },
        buttonstyle() {
            let progress = this.schemeinfo.buyMoney / this.schemeinfo.money;//0.49999
            let clearProgress = Math.floor(progress*10000)/10000;//0.125 0.1
            if (clearProgress < (this.minLimit / 100) && this.statusDescribe == 102) {
                this.btnDisabled = false
                return false
            } else {
                // modal.alert({message:this.schemeinfo.schedule+','+this.minLimit})
                this.btnStylecancle = {
                    backgroundColor: "#F5F5F5",
                    width: "375px",
                    height: "100px",
                    borderRadius: "0px"
                }
                this.btnStylechange = {
                    backgroundColor: "#EBEBEB",
                    width: "375px",
                    height: "100px",
                    borderRadius: "0px"
                }
                this.textStylechange = {
                    color: '#999999',
                    fontSize: '32px'
                }
                this.textStylecancle = {
                    color: '#999999',
                    fontSize: '32px'
                }
                this.btnDisabled = true;
            }
        },
        changorder() {
            if (this.btnDisabled) {
                return false
            }
            if (this.persontype == 2) {
                return modal.alert({
                    message: "参与人不可用"
                });
            }
            let progress = this.schemeinfo.buyMoney / this.schemeinfo.money;//0.49999
            let clearProgress = Math.floor(progress*10000)/10000;
            if (clearProgress* 100 > this.minLimit) {
                return modal.alert({
                    message: `进度大于${this.minLimit}%无法修改保底`
                });
            }
            // if(this.currentOrder.statusDescribe === '701'){
            //   return modal.alert({ message: "已撤单不可修改" });
            // }
            //修改保底

            

            this.schemeinfo.jumpType = "change";


            this.schemeinfo.lotteryLimit = JSON.stringify({
                minBuy:this.schemeinfo['minBuy'],
                minSafeguard:this.schemeinfo['minSafeguard'],
                maxRemuneration:this.schemeinfo['maxRemuneration']
            })

            this.schemeinfo.orderNo = this.currentOrder.orderNo
            
            this.schemeinfo.money = this.schemeinfo.money * this.schemeinfo.sorders.length

            let baseurl = getBaseUrl(weex.config.bundleUrl, true);
            let jUrl =
                baseurl + `views/guess/chipStart.js?` + serialize(this.schemeinfo);
            var params = {
                url: jUrl,
                animated: "true"
            };
            navigator.push(params);
            return;
        },
        async cancleorder() {
            if (this.btnDisabled) {
                return false
            }
            if (this.currentOrder.statusDescribe === '701') {
                return modal.alert({
                    message: "已撤单不可重复操作"
                });
            }
            if (this.persontype == 2) {
                return modal.alert({
                    message: "参与人不可用"
                });
            }
            let progress = this.schemeinfo.buyMoney / this.schemeinfo.money;//0.49999
            let clearProgress = Math.floor(progress*10000)/10000;
            if (clearProgress * 100 > this.minLimit) {
                return modal.alert({
                    message: `进度大于${this.minLimit}%无法撤单`
                });
            }
            this.loadingshow = true;
            let reqBody = {
                schemeId: this.schemeinfo.schemeId
            };

            //撤单
            try {
                let req = await postResponsesToken('order/bet/revokeTogether', {'schemeNo': this.schemeinfo.schemeNo})
                if (req.data) {
                    modal.alert({
                        message: "撤单成功"
                    });
                    navigator.pop();
                }
                this.loadingshow = false;
            } catch (e) {
                this.loadingshow = false;
        
                modal.toast({
                    message: e
                });
            }
        },
        filter_ball(betContent) {
            // 大乐透 双色球
            this.tablelist = betContent.map((i, index) => {
                var redball = i.redBall.split(",");
                var blueBall = i.blueBall.split(",");
                var danRedBall = i.danRedBall ? i.danRedBall.split(",") : [];
                var danBlueBall = i.danBlueBall ? i.danBlueBall.split(",") : [];
                var tuoRedBall = redball.filter(ii => !danRedBall.includes(ii));
                var tuoblueBall = blueBall.filter(iii => !danBlueBall.includes(iii));
                return {
                    danRedBall: danRedBall,
                    danBlueBall: danBlueBall,
                    tuoRedBall: tuoRedBall,
                    tuoblueBall: tuoblueBall,
                    redball: redball,
                    blueBall: blueBall,
                    type: this.filtertype(i.numberType)
                };
            });
        },
        filterarrow_3_4(betContent) {

            //福彩3D 排列三
            this.tablelist = betContent.map((i, index1) => {
                if (i.numberType == 1) {
                    //直选
                    if (
                        i.hundred.split(",").length > 1 ||
                        i.ten.split(",").length > 1 ||
                        i.ge.split(",").length > 1
                    ) {
                        // i.type = "组三直选复式";
                        return {
                            type: "直选复式",
                            number: i.hundred + "-" + i.ten + "-" + i.ge
                        };
                    } else {
                        return {
                            type: "直选单式",
                            number: i.hundred + "-" + i.ten + "-" + i.ge
                        };
                    }
                    //   i.number = i.hundred + "-" + i.ten + "-" + i.ge
                } else if (i.numberType == 2) {
                    //组三单式
                    //   i.number = i.chong + i.chong + i.dan;
                    //   i.type = "组三单式";
                    return {
                        type: "组三单式",
                        number: i.chong + i.chong + i.dan
                    };
                } else if (i.numberType == 3) {
                    //组三复式
                    if (i.no && i.dan) {
                        //组三胆拖
                        i.tuo = i.no
                            .split(",")
                            .filter(ii => !i.dan.split(",").includes(ii));
                        i.number = "胆" + i.dan + "拖" + i.tuo.join();
                        return {
                            number: i.number,
                            type: "组三胆拖"
                        };
                    } else {
                        //组三复式
                        // i.type = "组三复式";
                        i.number = i.no;
                        return {
                            number: i.number,
                            type: "组三胆拖"
                        };
                    }
                } else if (i.numberType == 4) {
                    //组六单式
                    if (i.no.split(",").length == 3 && !i.dan) {
                        // i.type = "组六单式";
                        return {
                            number: i.no,
                            type: "组六单式"
                        };
                    } else {
                        if (i.no && i.dan) {
                            // 组六胆拖
                            i.tuo = i.no
                                .split(",")
                                .filter(ii => !i.dan.split(",").includes(ii));
                            i.type = "组六胆拖";
                            i.number = "胆" + i.dan + "拖" + i.tuo.join();
                            return {
                                number: i.number,
                                type: i.type
                            };
                        } else {
                            //  组六复式
                            i.type = "组三复式";
                            i.number = i.no;
                            return {
                                number: i.number,
                                type: i.type
                            };
                        }
                    }
                }
            });
        },
        filterarrow_5(betContent) {
            //排列五
            this.tablelist = betContent.map((i, index) => {
                if (i.numberType == 5) {
                    //直选
                    if (
                        i.wan.split(",").length > 1 ||
                        i.thousand.split(",").length > 1 ||
                        i.hundred.split(",").length > 1 ||
                        i.ten.split(",").length > 1 ||
                        i.ge.split(",").length > 1
                    ) {
                        i.type = "直选复式";
                        i.number =
                            i.wan +
                            "-" +
                            i.thousand +
                            "-" +
                            i.hundred +
                            "-" +
                            i.ten +
                            "-" +
                            i.ge;
                        return {
                            type: i.type,
                            number: i.number
                        };
                    } else {
                        i.type = "直选单式";
                        i.number =
                            i.wan +
                            "-" +
                            i.thousand +
                            "-" +
                            i.hundred +
                            "-" +
                            i.ten +
                            "-" +
                            i.ge;
                        return {
                            type: i.type,
                            number: i.number
                        };
                    }
                }
            });
        },
        drawlottery(prizeDetails) {
            prizeDetails.forEach((item, index) => {
                if (item.drawNumber == null || item.drawNumber == '') {
                    item.waitlottery = true;
                }
                if (item.drawNumber) {
                    item.waitlottery = false;
                    if (item.drawNumber.indexOf("+") > -1) {
                        item.forward = item.drawNumber.split("+")[0];
                        item.forward = item.forward.split(",");
                        item.backward = item.drawNumber.split("+")[1];
                        item.backward = item.backward.split(",");
                    } else {
                        item.forward = item.drawNumber.split(",");
                    }
                }
                item.status = false;
                let prizeDetail = item.prizeDetail ? JSON.parse(item.prizeDetail) : "";
                if (prizeDetail) {
                    let moneytotal = 0;
                    let numbertotal = 0;
                    let afterMoneytotal = 0;
                    var prizeDetaildata = [];
                    for (var key in prizeDetail) {
                        let priceobj = {};
                        for (var key1 in prizeDetail[key]) {
                            if (key1 == "level") {
                                priceobj.level = prizeDetail[key][key1];
                            }
                            if (key1 == "money") {
                                moneytotal = prizeDetail[key][key1] + moneytotal;
                                priceobj.money = prizeDetail[key][key1];
                            }
                            if (key1 == "number") {
                                numbertotal = prizeDetail[key][key1] + numbertotal;
                                priceobj.number = prizeDetail[key][key1];
                            }
                            if (key1 == "afterMoney") {
                                priceobj.afterMoney = prizeDetail[key][key1];
                                afterMoneytotal = prizeDetail[key][key1] + afterMoneytotal;
                            }
                        }
                        prizeDetaildata.push(priceobj);
                    }
                    item.moneytotal = moneytotal;
                    item.numbertotal = numbertotal;
                    item.afterMoneytotal = afterMoneytotal;
                    item.prizeDetail = prizeDetaildata;
                    item.profitmoney =
                        ((item.prize - this.schemeinfo.money) *
                            this.schemeinfo.remuneration) /
                        100;
                    item.surplusmoney =
                        item.prize - item.profitmoney;
                    item.subscriptionmoney = this.schemeinfo.subscribe;

                    if (this.persontype == 1) {
                        item.dividemoney = (((this.schemeinfo.subscribe / this.schemeinfo.money) * (item.prize - item.profitmoney)) + item.profitmoney).toFixed(2)
                    } else {
                        item.dividemoney = ((this.schemeinfo.subscribe / this.schemeinfo.money) * (item.prize - item.profitmoney)).toFixed(2);
                    }
                }
			});
			
			

			this.lotterylist = prizeDetails;
			
        },
        filtertype(type) {
            let numbertype = "";
            switch (type) {
                case 6:
                    numbertype = "胆拖";
                    break;
                case 7:
                    numbertype = "复式";
                    break;
                case 8:
                    numbertype = "单式";
                    break;
            }
            return numbertype;
        },
        formatNum(num) {
            if (num < 10) return "0" + num;
            return num.toString();
        },
        tabactive(val, index) {
			let value = Object.assign(val, {'status' : !val.status})
			this.$set(this.lotterylist, index, value)
        }
    }
};
</script>

<style scoped>
.batdetail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(245, 245, 245);
}

.bottombutton {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 96px;
    width: 750px;
    display: flex;
    flex-direction: row;
}

.scheme_title {
    margin-left: 32px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.bottombutton_item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.batdetail_desc_fl_item {
    margin-left: 32px;
    margin-bottom: 24px;
    flex-direction: row;
    align-items: center;
}

.batdetail_desc_fr_item {
    margin-left: 32px;
    margin-bottom: 24px;
    flex-direction: row;
    align-items: center;
}

.lottery_img {
    position: absolute;
    width: 200px;
    height: 129px;
    top: -60px;
    right: 80px;
}

.batdetail_desc {
    padding-top: 32px;
    display: flex;
    flex-direction: row;
    background-color: #ffffff;
    border-radius: 4px;
}

.batdetail_desc_fl {
    flex: 1;
}

.batdetail_desc_fr {
    flex: 1;
}

.scheme_message {
    padding-top: 32px;
    padding-left: 30px;
    padding-bottom: 104px;
}

.number {
    padding-left: 72px;
    padding-right: 72px;
}

.batdetail_lotteryinfo {
    margin-top: 24px;
}

.showtab {
    width: 750px;
    height: 88px;
    align-items: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
}

.arrowposition {
    position: absolute;
    top: 50%;
    margin-top: -12px;
    right: 32px;
}

.arrowposition1 {
    position: absolute;
    top: 50%;
    margin-top: -24px;
    right: 32px;
}

.showcontent {
    box-shadow: 4px 0 0 15px rgba(229, 229, 229, 0.5);
    margin-top: 2px;
}

.showtabcontent_fl {
    margin-left: 32px;
    display: flex;
    flex-direction: row;
}

.showtabcontent_fr {
    margin-right: 32px;
}

.backgroud0 {
    background-color: rgba(229, 229, 229, 0.5);
}

.backgroud1 {
    background-color: #fff3f3;
}

.backgroud2 {
    background-color: white;
}

.bGroup {
    padding: 24px 0 32px 0;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
}

.forward {
    color: #333333;
    font-size: 32px;
    font-family: PingFangSC-Medium;
    height: 64px;
    line-height: 64px;
    width: 64px;
    border-radius: 50%;
    display: flex;
    text-align: center;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    border-width: 1px;
    border-style: solid;
    border-color: #a7a7a7;
}

.backward {
    font-family: PingFangSC-Medium;
    font-size: 32px;
    height: 64px;
    line-height: 64px;
    width: 64px;
    border-radius: 50%;
    display: flex;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-width: 1px;
    border-style: solid;
    border-color: #1c5aaf;
    color: #076bf2;
}

.lottery_money {
    height: 96px;
    margin-top: 32px;
    margin-left: 32px;
    margin-right: 32px;
    border-style: solid;
    border-color: #666666;
    border-top-width: 1px;
    border-left-width: 1px;
    border-right-width: 1px;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: row;
}

.lottery_thead {
    height: 60px;
    margin-left: 32px;
    margin-right: 32px;
    border-width: 1px;
    border-style: solid;
    border-color: #666666;
    border-bottom-width: none;
    justify-content: space-between;
    align-items: center;
    display: flex;
    flex-direction: row;
    margin-bottom: 32px;
}

.lottery_tbody {
    margin-bottom: 32px;
    margin-left: 32px;
    margin-right: 32px;
    justify-content: space-between;
    align-items: center;
    display: flex;
    flex-direction: row;
}

.lottery_total {
    height: 64px;
    margin-left: 32px;
    margin-right: 32px;
    border-width: 1px;
    border-style: solid;
    border-color: #666666;
    justify-content: space-between;
    align-items: center;
    display: flex;
    flex-direction: row;
    margin-bottom: 32px;
}

.last_one_lottery_total {
    margin-left: 32px;
    margin-right: 32px;
    margin-top: 44px;
    border-width: 1px;
    border-style: solid;
    border-color: #666666;
}

.batdetail_table {
    background-color: white;
    border-radius: 4px;
    padding-top: 24px;
    margin-bottom: 24px;
}

.batdetail_lotteryinfo_title {
    display: flex;
    margin-top: 32px;
    margin-bottom: 24px;
    margin-left: 32px;
    flex-direction: row;
    align-items: center;
}

.lottery_thead_item {
    width: 150px;
    justify-content: center;
    align-items: center;
}

.lottery_thead_item1 {
    width: 200px;
    justify-content: center;
    align-items: center;
}

.nozhongjiang {
    margin-left: 72px;
    margin-bottom: 48px;
}

.table_subdesc {
    padding-left: 32px;
    padding-bottom: 32px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.batdetail_table_title {
    margin-top: 32px;
    margin-bottom: 24px;
    margin-left: 32px;
    display: flex;
    flex-direction: row;
    background-color: rgb(245, 245, 245);
    align-items: center;
}

.last_one_lottery_detail {
    display: flex;
    flex-direction: row;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #666666;
}

.last_lottery_detail_fr {
    height: 95px;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.last_second_lottery_detail {
    display: flex;
    flex-direction: row;
}

.last_second_lottery_detail_item {
    flex: 1;
    height: 103px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    border-left-width: 1px;
    border-bottom-width: 1px;
    border-left-style: solid;
    border-bottom-style: solid;
    border-bottom-color: #666666;
    border-left-color: #666666;
}

.last_second_lottery_detail_item1 {
    flex: 2;
    height: 103px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    border-left-width: 1px;
    border-bottom-width: 1px;
    border-left-style: solid;
    border-bottom-style: solid;
    border-bottom-color: #666666;
    border-left-color: #666666;
}

.desc {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 662px;
    font-size: 28px;
    color: #999999;
}
</style>
